/**   
* @Title: LogDAOImpl.java 
* @Package com.medsoft.logpool.core 
* @Description: TODO(用一句话描述该文件做什么) 
* @author zjhua@hundsun.com   
* @date 2016年6月27日 下午1:54:19 
* @version V1.0   
*/ 
package com.medsoft.logpool.core;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

/**
 * @author zjhua
 *
 */
@Repository
public class LogDAOImpl implements LogDAO {
	
	private static final String DAO_NAMESPACE = "com.medsoft.logpool.mybatis.Log4j.";
	
	@Autowired
	private SqlSession sqlSession;

	/* (non-Javadoc)
	 * @see com.medsoft.logpool.core.LogDAO#addLog(java.util.Map)
	 */
	@Override
	public void addLog(Map<String, String> param) {
		sqlSession.insert(DAO_NAMESPACE + "insert", param);
	}

	/* (non-Javadoc)
	 * @see com.medsoft.logpool.core.LogDAO#queryLog()
	 */
	@Override
	public List<AppLog> queryLog(Map<String, String> param) {
		List<AppLog> results = sqlSession.selectList(DAO_NAMESPACE + "queryLog",param);
		if (results == null) {
			results = new ArrayList<AppLog>();
		}
		return results;
	}
}
